﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using HuaweiCloud.Dotnet.Samples.ESports.Dbs;
using HuaweiCloud.Dotnet.Samples.ESports.Entities;
using HuaweiCloud.Dotnet.Samples.ESports.Services;

namespace HuaweiCloud.Dotnet.Samples.ESports.Pages.Steps
{
    public class IndexModel : PageModel
    {
        private readonly IStepAppService _service;

        public IndexModel(IStepAppService service)
        {
            _service = service;
        }

        public IList<Step> Step { get;set; } = default!;

        /// <summary>
        /// 页面准备就绪后调用的方法
        /// </summary>
        /// <returns></returns>
        public async Task OnGetAsync()
        {
            // 获取列表
            Step = await _service.ListAsync();
        }
    }
}
